#include <iostream>
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#include <cstdlib>
#include <cstring>
#include <string>

using namespace std;

void Usage(const string& proc)
{
    cout <<"Usage" << proc << "signo pid" << endl; 
}

int main(int args, char* argv[])
{
    cout << "pid: " << getpid() << endl;
    if (args != 3)
    {
        Usage((char*)argv[0]);
        exit(-1);
    }
    if (kill(static_cast<pid_t>(atoi(argv[2])),atoi(argv[1])) == -1)
    {
        cerr << "kill" << strerror(errno) << endl;
        exit(-2);
    }
            
    return 0;
}
